package itsm.isperp.module.controller.bpm;

import java.sql.SQLException;

import itsm.isperp.framework.template.TemplateException;
import itsm.isperp.framework.web.controller.BaseController;
import itsm.isperp.module.dto.bpm.BpmRelationProcessMapDTO;
import itsm.isperp.module.entity.bpm.BpmRelationProcessMap;
import itsm.isperp.module.service.bpm.BpmRelationProcessMapService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 控制器
 * 
 * @author lizx
 * @date 2015-02-03 11:13
 */
@Controller
@RequestMapping("bpm/relationProcessMap")
public class BpmRelationProcessMapController extends
		BaseController<BpmRelationProcessMap> {

	@Autowired
	protected BpmRelationProcessMapService bpmRelationProcessMapService;

	@Override
	public BpmRelationProcessMapService getService() {
		return this.bpmRelationProcessMapService;
	}

	@Override
	public String getPageTitle() {
		return "流程关联映射";
	}

	/**
	 * 
	 * 
	 * @param formId
	 * @param fromProcessKey
	 * @param processKey
	 * @return
	 * @throws SQLException
	 * @throws TemplateException
	 */
	@RequestMapping("getRelationMap")
	@ResponseBody
	public BpmRelationProcessMapDTO[] getRelationMap(String fromId,
			String fromProcessKey, String processKey) throws SQLException,
			TemplateException {
		return this.bpmRelationProcessMapService.getRelationMap(fromId,
				fromProcessKey, processKey);
	}

}
